Skip to content

feat: Add MISP Sharing Pipeline engine - #87

Draft
remid0c wants to merge 2 commits into
developmentfrom
feature/misp-sharing-pipeline
Draft

feat: Add MISP Sharing Pipeline engine#87
remid0c wants to merge 2 commits into
developmentfrom
feature/misp-sharing-pipeline

Conversation

@remid0c

@remid0c remid0c commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Add MISP Sharing Pipeline Engine

Summary

This PR implements a new CoreTIDE engine that publishes OpenTIDE objects (TVM, DOM, MDR) as MISP events to one or more configured MISP instances. The pipeline follows the established CoreTIDE engine pattern and integrates with existing CI workflows.

Features

  • TLP-Based Sharing Scope: Objects are filtered per MISP instance based on max_allowed_tlp configuration. Supports full TLP hierarchy (clear/white, green, amber, amber+strict, red) with case-insensitive parsing.

  • Version Control: Compares local object version against remote MISP event version. Creates new events when none exist, updates when local > remote, skips when versions are current.

  • Deterministic Event UUIDs: MISP event UUIDs are derived deterministically from OpenTIDE object UUIDs using UUID5 namespacing, ensuring consistent event identity across instances.

  • Relation Resolution:

    • TVM: Recursive chaining resolution via DataTide.Models.chaining with cycle protection
    • DOM: Direct reference to objective.threats UUIDs
    • MDR: Single detection_model UUID reference
  • MISP Event Tagging:

    • TLP tags in MISP taxonomy format (tlp:green, etc.)
    • ATT&CK technique tags via techniques_resolver()
    • Threat actor galaxy clusters with priority logic (MISP-stage > ATT&CK-stage)
  • CI Integration: Supports GitHub Actions, GitLab CI, and Azure Pipelines. Skips on PR/MR events, executes on default branch push and LocalDebug mode.

  • Fail-Forward Error Handling: Connection failures to one MISP instance don't halt processing of others. API errors on individual objects are logged and processing continues.

Components Added

Path Description
Engines/modules/sharing.py TLPLevel enum, configuration dataclasses, config loader
Engines/sharing/__init__.py Package init
Engines/sharing/connector.py PyMISP client factory with proxy/SSL support
Engines/sharing/scope.py TLP-based sharing scope computation
Engines/sharing/relations.py Relation resolution (TVM chains, DOM threats, MDR detection_model)
Engines/sharing/events.py MISP event existence check, creation, and update
Engines/sharing/tagging.py TLP tags, ATT&CK tags, actor galaxy builders
Orchestration/share.py Entry point orchestrator
.github/workflows/sharing.yml Reusable GitHub Actions workflow
Pipelines/GitHub/sharing/action.yml Composite action

Configuration

The pipeline reads from sharing.toml:

[organisation]
enabled = true
name = "My Organisation"
uuid = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"

[[misp]]
name = "Internal MISP"
url = "https://misp.internal.org"
token = "$MISP_INTERNAL_TOKEN"  # Resolved from env var
org_uuid = "11111111-2222-3333-4444-555555555555"
max_allowed_tlp = "amber"
mode = "send"
proxy = false
publish_on_change = true
verify_ssl = true

Testing

  • 103 tests covering all requirements
  • Property-based tests using Hypothesis for:
    • TLP hierarchy ordering
    • Configuration parsing/validation
    • Scope filtering correctness
    • Version comparison logic
    • TVM chaining resolution
    • MISP object attribute completeness
    • Tag format correctness
  • Unit tests with mocked PyMISP for API interactions
  • Integration tests for end-to-end flow

Requirements Covered
All 9 requirement groups from the spec:

  1. Sharing Configuration Schema
  2. TLP-Based Sharing Scope
  3. MISP Event Existence Check
  4. Version Comparison and Update Decision
  5. MISP Event Creation and Structure
  6. MISP Event Tagging
  7. CI Pipeline Integration
  8. Error Handling and Logging
  9. SSL and Network Configuration

Dependencies

  • pymisp added to requirements.txt

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@remid0c
remid0c marked this pull request as draft June 25, 2026 07:06
@remid0c remid0c self-assigned this Jun 25, 2026
@remid0c
remid0c requested a review from behemothsecurity June 25, 2026 07:06
@remid0c remid0c added enhancement New feature or request tidekit Project TideKit — CoreTide → opentide package transformation labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tidekit Project TideKit — CoreTide → opentide package transformation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant